#include<bits/stdc++.h>
using namespace std;
const int MaxN = 100005;
int arr[MaxN];
void MaxSum(int t)
{
	int n;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}

	int maxSum = arr[0], start = 1, end = 1;
	int cur = arr[0];
	for(int i=1;i<=n;i++){
		cur += arr[i];
		if(cur > maxSum){
			maxSum = cur;
			end = i+1;
		}
		if(cur < 0 ){
			cur = 0;
			start = i + 2;
		}
		
	}
//	int dp[100001] = {0};
//	dp[0] = arr[0];

//	for(int i=1;i<n;i++){
//		if(dp[i - 1] > 0){
//			dp[i] = dp[i-1] + arr[i];
//		}else{
//			dp[i] = arr[i];
//			start = i;
//		}
//		if(dp[i] > maxSum){
//			maxSum =  dp[i];
//			end = i;
//		}
//	}

//	cout << "================" << endl;
	cout << "Case #" << t << ":" << endl;
	cout << maxSum << " " << start  << " " << end << endl;

}
int main ()
{
	int T;
	cin>>T;
//	T = 1;
	for (int i = 1; i <= T; i++) {
		MaxSum(T);
		if (i != T) {
			cout << endl;
		}
	}
	return 0;
}
